Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the configurable refetchWaitSeconds parameter #99

Closed
wants to merge 2 commits into from

Conversation

moxli
Copy link

@moxli moxli commented Dec 14, 2023

It can happen that the results refetched from the DefectDojo API are
incorrect.
This only happens if the deduplication feature is enabled in DefectDojo.
The cause for this is that after importing a finding is deduplicated
in the background and depending on how performant your DefectDojo is,
this might take a couple of seconds to finish.

If the results are refetched before the deduplication finishes and the
status of all findings has been updated, the results we get back from
the API will not be correct.

The attributes which might be incorrect include but are not limited to
falsePositive, duplicate, riskAccepted and outOfScope.

Allowing the user to configure a sleep/wait in seconds helps to fix this
in flexible way. By allowing the user adjust this depending on the load
and performance on their DefectDojo installation.

Signed-off-by: Maximilian Dorner <[email protected]>
By making sure the new parameter is in the last place we keep is a non
breaking change.

Signed-off-by: Maximilian Dorner <[email protected]>
@J12934
Copy link
Member

J12934 commented Jan 5, 2024

@moxli for me this should be ready to go.
It's still marked as draft, anything you'd still like to change? :)

@moxli
Copy link
Author

moxli commented Jan 5, 2024

@J12934 Thank you :)
I would love to get feedback to on this question here:
secureCodeBox/secureCodeBox#2133 (comment)

I was thinking about adding a separate service like you mentioned here:
secureCodeBox/secureCodeBox#2133 (comment)

Because if it shall be part of the hook I guess we would need to implement the wait parameter in PersistenceProviderConfig.java? :)

@J12934
Copy link
Member

J12934 commented Jan 5, 2024

@J12934 Thank you :) I would love to get feedback to on this question here: secureCodeBox/secureCodeBox#2133 (comment)

I was thinking about adding a separate service like you mentioned here: secureCodeBox/secureCodeBox#2133 (comment)

Because if it shall be part of the hook I guess we would need to implement the wait parameter in PersistenceProviderConfig.java? :)

Ah sorry forgot about the question.
Would be fine to me to only keep this part of the hook and not of this client.
This client is pretty low level and doesn't handle the refetching.

Writing this I'm now wondering if we really want to put this config in the client config at all :/
It's basically only for the hook and not relevant for other use cases. Mabye we just implement this entierly in the Hook and just read this out of the envionment variables inside of this DeduplicationAwaitingService? Then we wouldn't have to touch this lib at all.

@J12934 J12934 self-requested a review January 5, 2024 15:23
@moxli
Copy link
Author

moxli commented Jan 5, 2024

@J12934 Yes I agree with you.

I will try to implement this inside of the hook change the PR if it works. :)

@moxli moxli closed this Jan 10, 2024
@moxli
Copy link
Author

moxli commented Jan 10, 2024

This is to be continued without changes to this lib here: secureCodeBox/secureCodeBox#2133

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a configurable sleep/wait to the client configuration
2 participants